<template>
  <div class="box">
    <RenderTable 
      :superQueryFieldList="superQueryFieldList" 
      :queryParamArr = "queryParamArr"
      :defColumns="defColumns"
      :url = "url"
      @handleEdit = "handleEdit"
      ref='renderTable'
    >


      <template slot="btn">
        <p-button type="primary" @click="showAddModal" style="margin-right: 10px">新增</p-button>
      </template>


    </RenderTable>

    <AssessTemplateModal ref='assessTemplateModal' @handleSuccess = 'handleSuccess'></AssessTemplateModal>

  </div>
</template>

<script type="text/javascript">
import RenderTable from '@/components/renderTable'
import AssessTemplateModal from './modules/assessTemplateModal.vue'

const superQueryFieldList =
[
  {
    value: "organization",
    text: "组织",
    type: "String",
  }, 
  {
    value: "empname",
    text: "员工姓名",
    type: "String",
  },
]
export default {
  data() {
    return {
      superQueryFieldList,
      queryParamArr: [
        {
          label: "技能名称",
          placeholder: "请输入技能名称",
          type: 'input',
          key: 'skillName',
          value: ''
        }
      ],
      defColumns: [
        {
          title: "序号",
          dataIndex: "",
          key: "rowIndex",
          width: 60,
          align: "center",
          customRender: (t, r, index) => {
            return parseInt(index) + 1;
          },
        },
        {
          title: "技能编码",
          align: "center",
          dataIndex: "skillNo",
        },
        {
          title: "技能名称",
          align: "center",
          dataIndex: "skillName",
        },
        {
          title: "模板类别",
          align: "center",
          dataIndex: "templateType",
        },
        {
          title: "考核模板编号",
          align: "center",
          dataIndex: "assessTemplateNo",        
        },
        {
          title: "考核模板名称",
          align: "center",
          dataIndex: "assessTemplateName",        
        },
        {
          title: "考核人",
          align: "center",
          dataIndex: "assesser",
        },
        {
          title: "创建人",
          align: "center",
          dataIndex: "createBy",
        },
        {
          title: "创建日期",
          align: "center",
          dataIndex: "createTime",
        },
        {
          title: "修改人",
          align: "center",
          dataIndex: "updateBy",
        },
        {
          title: "修改日期",
          align: "center",
          dataIndex: "updateTime",
        },
        {
          title: "合格分数(包含)",
          align: "center",
          dataIndex: "passScore",
        },
        {
          title: "状态",
          align: "center",
          dataIndex: "status",
          scopedSlots: { customRender: "status" },
        },
        {
          title: "操作",
          dataIndex: "action",
          align: "center",
          scopedSlots: { customRender: "action" },
        },
      ],
      skillPropertyKeys: {},
      url: {
        list: '/mes-manpower/mesHrAssessTemplate/list',
        delete: '/mes-manpower/mesHrAssessTemplate',
        editStatus: '/mes-manpower/mesHrAssessTemplate/status',
      },
    
      layout: {
        labelCol: { span: 4 },
        wrapperCol: { span: 14 },
      },         
    }
  },



  mounted() {
  },
  methods: {

    handleEdit(record){
      this.$refs.assessTemplateModal.showModal(record)
    },
    // 显示新增弹窗
    showAddModal(){
      this.$refs.assessTemplateModal.showModal()
    },
    handleSuccess(){
      this.$refs.renderTable.loadData()
    }
  },
  components: {
    RenderTable,
    AssessTemplateModal
  }
}
</script>

<style lang="less" scoped>
</style>

